Ext.define('AkData.store.OrguKumasSiparisler2_Store', {
	alias: 'store.OrguKumasSiparisler2_Store',
	extend: 'Ext.data.Store',
	config: {
		storeId: 'OrguKumasSiparisler2_Store',
		autoLoad: false,
		
		fields: [
			{name: 'id', type: 'int'},
			{name: 'periyod', type: 'string'},
			{name: 'suprem', type: 'int', mapping: function(data, record) {return parseInt(data.suprem) / AkData.app.Bolum;}},
			{name: 'ribana', type: 'int', mapping: function(data, record) {return parseInt(data.ribana) / AkData.app.Bolum;}},
			{name: 'kadife', type: 'int', mapping: function(data, record) {return parseInt(data.kadife) / AkData.app.Bolum;}},
			{name: 'diger', type: 'int', mapping: function(data, record) {return parseInt(data.diger) / AkData.app.Bolum;}},
			
			{name: 'toplam_sum', type: 'int', mapping: function(data, record) {return parseInt(data.toplam_sum) / AkData.app.Bolum;}},
			
			{name: 'hedef', type: 'int', mapping: function(data, record) {return parseInt(data.hedef) / AkData.app.Bolum;}},
			{name: 'gercek', type: 'int',
				mapping: function(data, record) {
					return (parseInt(data.ribana) + parseInt(data.suprem) + parseInt(data.kadife) + parseInt(data.diger)) / AkData.app.Bolum;
				}
			},
			
			{name: 'yuzde', type: 'int', mapping: function(data, record) {
				return Math.round(Math.round((Math.round(data.suprem) + Math.round(data.ribana) + Math.round(data.kadife) + Math.round(data.diger))) / Math.round(data.toplam_sum) * 100);
				}
			},
		],
		
		proxy: {
			type: 'ajax', url: 'php/select.php?table=OrguKumasSiparisler2',
			reader: {type: 'json', idProperty: 'id', messageProperty: 'message', totalProperty: 'total', rootProperty: 'data'},
		},
	},
});